<template>
  <el-container>
    <el-header>
      <f-header />
    </el-header>
    <el-container>
      <el-aside :width="store.state.asideWidth">
        <f-menu></f-menu>
      </el-aside>
      <el-main class="el-main">
        <f-tag-list />
        <router-view v-slot="{ Component }">
          <transition name="fade">
            <keep-alive :max="10">
              <component :is="Component"></component>
            </keep-alive>
          </transition>
        </router-view>
      </el-main>
    </el-container>
  </el-container>
</template>
<script lang="ts">
import { defineComponent } from 'vue';
import { useStore } from 'vuex';
import FHeader from './components/Header/Header.vue';
import FMenu from './components/Sider/Sider.vue';
import FTagList from './components/TagList/TagList.vue';
export default defineComponent({
  components: {
    FHeader,
    FMenu,
    FTagList
  },
  setup() {
    const store = useStore()
    return {
      store
    }
  }
})

</script>
<style>
.el-aside {
  transition: all 0.2s;
}

.fade-enter-from {
  opacity: 0;
}

.fade-enter-to {
  opacity: 1;
}

.fade-leave-from {
  opacity: 1;
}

.fade-leave-to {
  opacity: 0;
}

.fade-enter-active,
.fade-leave-active {
  transition: all 0.3s;
}

.fade-enter-active {
  transition-delay: 0.3s;
}
</style>
